<link href="__PUBLIC__/css/style.default.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="__PUBLIC__/js/html5shiv.js"></script>
<script src="__PUBLIC__/js/respond.min.js"></script>
<![endif]-->

<div class="mainpanel">
    <div class="pageheader">
        <div class="media">
            <div class="pageicon pull-left">
                <i class="fa fa-th-list"></i>
            </div>
            <div class="media-body">
                <ul class="breadcrumb">
                    <li><a href=""><i class="glyphicon glyphicon-home"></i></a></li>
                    <li><a href="">首页</a></li>
                    <li>会员管理</li>
                </ul>
                <h4>会员管理</h4>
            </div>
        </div><!-- media -->
    </div>

    <div class="contentpanel">

        <div class="panel panel-primary-head">
            <div id="succ_file_s" class="alert alert-success hides">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                <strong>用户添加成功</strong>
            </div>

            <div id="faild_file_s" class="alert alert-danger hides">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                <strong>用户添加失败,请检查！</strong>
            </div>

            <div class="row" style="padding: 0 15px">

            </div>
            <div class="row hides" >
                <div class="col-md-6">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <div class="panel-btns" style="display: none;">
                                <a href="" class="panel-minimize tooltips" data-toggle="tooltip" title="" data-original-title="Minimize Panel"><i class="fa fa-minus"></i></a>
                            </div><!-- panel-btns -->
                            <h4 class="panel-title">添加用户</h4>
                            <p style="    color: #fff;">点击右上角显示更多</p>
                        </div><!-- panel-heading -->
                        <div class="panel-body" style="display: none;">
                            <form id="user_add_ajaxForm" method="post" action="{:url('admin/user/useradd')}" enctype="multipart/form-data">

                                <div class="row">
                                    <div class="form-group col-md-4">
                                        <label>选择机构</label>
                                        <select id="select-search-hide" name="org_code" data-placeholder="Choose One" class="width300">
                                            {volist name="org_list" id="vo"}
                                            <option value="{$vo.org_code}">{$vo.org_name}</option>
                                            {/volist}

                                        </select>
                                    </div>

                                </div>
                                <div class="row">
                                    <div class="form-group col-md-4" >
                                        <label>角色</label>
                                        <select name="user_role" class="form-control">
                                            <option value="1">超级管理员</option>
                                            <option value="2">机构管理员</option>
                                            <option value="3">教练</option>
                                        </select>
                                    </div>
                                    <div class="form-group col-md-4" >
                                        <label>邮箱</label>
                                        <input type="email" name="user_email" placeholder="邮箱" class="form-control">
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="form-group col-md-4">
                                        <label>用户名</label>
                                        <input type="text" name="acc_name" placeholder="用户名" class="form-control">
                                    </div>
                                    <div class="form-group col-md-4">
                                        <label>密码</label>

                                        <input type="password" name="acc_pwd" placeholder="密码" class="form-control">
                                    </div>
                                    <div class="form-group col-md-4">
                                        <label>重复密码</label>
                                        <input type="password" name="re_acc_pwd" placeholder="重复密码" class="form-control">
                                    </div>
                                </div><!-- row -->
                            </form>

                        </div><!-- panel-body -->

                        <div class="panel-footer" style="display: none;">
                            <button id="USER_ADD_FROM_BTN" class="btn btn-primary">添加</button>
                        </div><!-- panel-footer -->
                    </div><!-- panel -->

                </div>
            </div>

            <table id="exRowTable" class="table table-striped table-bordered">
                <thead>
                <tr>
                    <th>序号</th>
                    <th>姓名</th>
                    <th>创建时间</th>
                    <th>性别</th>
                    <th>出生年份</th>
                    <th>身高</th>
                    <th>体重</th>
                    <th>手机号码</th>
                    <th>训练目的</th>
                    <th>机构编码</th>
                    <th>状态</th>
                </tr>
                </thead>
            </table>
        </div><!-- panel -->

    </div>

</div>
<!--madol 修改密码 hide-->
<div id="user_paw_save_madol" class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button aria-hidden="true" data-dismiss="modal" class="close" type="button">&times;</button>
                <h4 class="modal-title"><span id="username_save"></span>修改密码</h4>
            </div>
            <div class="modal-body">
                <div id="user_paw_save_param" class="row" style="padding-right: 2rem;padding-left: 2rem">
                    <div class="row">
                        <label>原密码</label>
                        <input type="password" name="ipwd"  class="form-control">
                        <input id="username_param" type="hidden" name="username_param">
                    </div>
                    <div class="row">
                        <label>新密码</label>
                        <input type="password" name="npwd"  class="form-control">
                    </div>
                    <div class="row">
                        <label>重复新密码</label>
                        <input type="password" name="renpwd"  class="form-control">
                    </div>
                    <div class="row" style="padding-right: 1rem;padding-top: 1rem" >
                        <button style="float: right;" id="USER_PWD_EDIT_FROM_BTN" class="btn btn-primary">提交</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<style>
    .hides{
        display: none;
    }

</style>
<script>

    var exRowTable;
    $(function(){

        exRowTable = $('#exRowTable').DataTable({
            responsive: true,
            "fnDrawCallback": function(oSettings) {
                jQuery('#exRowTable_paginate ul').addClass('pagination-active-success');
            },
            "ajax": "{:url('admin/customer/customerquery')}",
            "columns": [
                { "data": "cust_sn" },
                { "data": "cust_name" },
                { "data": "create_date"},
                { "data": "sex" },
                { "data": "birth_year" },
                { "data": "height" },
                { "data": "weight" },
                { "data": "mobile" },
                { "data": "train_target" },
                { "data": "org_code" },
                {"data": "mark","render": function ( data, type, full, meta ) {
                        switch (data){
                            case '1':
                                return '正常';
                                break;
                            case '0':
                                return '禁用';
                                break;
                            default:
                                return'未知';
                                break
                        }
                    }
                 },
                /*{ "data": "cust_sn","render": function ( data, type, full, meta ) {
                        return '<button onclick="user_paw_save_view('+data+',\''+full.cust_sn+'\')" class="btn btn-primary btn-xs">修改密码</button> <span>  </span><button onclick="user_del('+data+')" class="btn btn-danger btn-xs">删除</button>';
                    }
                 },*/
            ],
            "order": [[0, 'desc']]
        });

    })

</script>



